Component({
    properties: {
        bgcolor: {
            type: String,
            value: "#fafafa"
        },
        selector: {
            type: String,
            value: "skeleton"
        },
        lazyLoad: {
            type: Boolean,
            value: !1
        },
        position: {
            type: "String",
            value: "absolute"
        }
    },
    data: {
        systemInfo: {},
        rectLists: [],
        circleLists: []
    },
    attached: function() {
        var t = getApp().globalData.systemInfo;
        this.setData({
            systemInfo: {
                width: t.windowWidth,
                height: t.windowHeight
            }
        });
    },
    ready: function() {
        this.data.lazyLoad || this.initialize(getCurrentPages().slice(-1)[0]);
    },
    methods: {
        create: function(t) {
            this.initialize(t);
        },
        initialize: function(t) {
            var e = this;
            this.bgHandle(t).then(function() {
                e.rectHandle(t), e.radiusHandle(t);
            });
        },
        bgHandle: function(t) {
            var i = this;
            return new Promise(function(n) {
                wx.createSelectorQuery().in(t).selectAll(".".concat(i.data.selector)).boundingClientRect(function(t) {
                    var e = t[0] || {
                        top: 0,
                        height: 0
                    };
                    i.top = e.top, i.setData({
                        "systemInfo.height": e.height
                    }), n();
                }).exec();
            });
        },
        rectHandle: function(t) {
            var n = this;
            wx.createSelectorQuery().in(t).selectAll(".".concat(this.data.selector, "-rect")).boundingClientRect().exec(function(t) {
                var e = n.handleTop(t[0]);
                n.setData({
                    rectLists: e
                });
            });
        },
        radiusHandle: function(t) {
            var n = this;
            wx.createSelectorQuery().in(t).selectAll(".".concat(this.data.selector, "-radius")).boundingClientRect().exec(function(t) {
                var e = n.handleTop(t[0]);
                n.setData({
                    circleLists: e
                });
            });
        },
        handleTop: function(t) {
            var e = this.top;
            return t.map(function(t) {
                return t.top = t.top - e, t;
            });
        }
    }
});